package com.yzt.minemodule.activity;

import android.app.Activity;
import android.content.Intent;

import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.yzt.zhuju.base.BaseActivity;
import com.yzt.minemodule.R;

import java.util.ArrayList;
import java.util.List;

/**
 * author : bob
 * date   : 2022/12/1
 * desc   : 权限说明
 */
@Deprecated
public class PermissionsDetailsActivity extends BaseActivity {

    private ItemAdapter mItemAdapter;

    public static void start(Activity activity) {
        activity.startActivity(new Intent(activity, PermissionsDetailsActivity.class));
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_permissions_details;
    }

    @Override
    public void installViews() {
        mTitleBar.setTitle(getString(R.string.permission_desc));

        RecyclerView mListRv = findViewById(R.id.list_rv);
        mItemAdapter = new ItemAdapter();
        mListRv.setAdapter(mItemAdapter);
    }

    @Override
    protected void onResume() {
        super.onResume();
        List<PermissionBean> list = new ArrayList<>();
        list.add(new PermissionBean("位置信息", "允许获取位置信息，您可以使用同城，附近功能"));
        list.add(new PermissionBean("存储权限", "允许访问您的内存卡，您可以进行存储/保存喜欢的图片"));
        list.add(new PermissionBean("相机", "允许访问您的相机，您可以拍摄照片或视频通话"));
        list.add(new PermissionBean("麦克风", "允许使用麦克风，您可以进行语音通话或录制音频"));
        list.add(new PermissionBean("手机状态权限", "允许访问手机状态权限，您可以一键登录"));
        list.add(new PermissionBean("悬浮窗权限", "允许悬浮窗权限后，您可以将聊天室、音视频通话窗口化、实时收到通话来电提醒。"));
        list.add(new PermissionBean("通讯录权限", "允许通讯录权限后，您可以便捷的将相关转接号码保存至通讯录。"));
        mItemAdapter.setList(list);
    }

    static class ItemAdapter extends BaseQuickAdapter<PermissionBean, BaseViewHolder> {

        public ItemAdapter() {
            super(R.layout.item_permissions_details);
        }

        @Override
        protected void convert(BaseViewHolder helper, PermissionBean item) {
            helper.setText(R.id.title_tv, item.title);
            helper.setText(R.id.content_tv, item.content);
        }
    }

    static class PermissionBean {

        String title;

        String content;

        public PermissionBean(String title, String content) {
            this.title = title;
            this.content = content;
        }
    }
}
